#include <iostream>
#include <unistd.h>
#include <sys/eventfd.h>
using namespace std;

int main() {
    int efd = eventfd(1, EFD_NONBLOCK | EFD_CLOEXEC);
    if (efd == -1) {
        cout << "eventfd error" << endl;
        return -1;
    }
    uint64_t b = 10;
    write(efd, &b, sizeof(uint64_t));
    // close(efd);
    read(efd, &b, sizeof(uint64_t));
    cout << "b: " << b << endl;
    close(efd);
    return 0;
}